using System.Data;
using System.Data.SqlClient;
using Framework.Library;

namespace Framework.Module.Logging.Statistic
{
    public class StatisticDB
    {
        public static DataTable GetNumberContent_User(string startday, string lastday)
        {
            DataTable tab = null;
            SqlConnection con = new SqlConnection(AppEnv.ConnectionString);
            SqlCommand com = new SqlCommand("CMS_StatisticContentbyUserID", con);
            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@startdate", startday);
            com.Parameters.AddWithValue("@lastdate", lastday);
            try
            {
                SqlDataAdapter da = new SqlDataAdapter(com);
                tab = new DataTable();
                da.Fill(tab);
            }
            catch
            {
                return tab;
            }
            return tab;
        }
        //CMS_StatisticContentbyUserIDandAlias

        public static DataTable GetNumberContent_UserandAlias(string startday, string lastday)
        {
            DataTable tab = null;
            SqlConnection con = new SqlConnection(AppEnv.ConnectionString);
            SqlCommand com = new SqlCommand("CMS_StatisticContentbyUserIDandAlias", con);
            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@startdate", startday);
            com.Parameters.AddWithValue("@lastdate", lastday);
            try
            {
                SqlDataAdapter da = new SqlDataAdapter(com);
                tab = new DataTable();
                da.Fill(tab);
            }
            catch
            {
                return tab;
            }
            return tab;
        }
    }
}
